Github pages#

Set up a Custom domain#

  1. DNS: Add an A record point to github server.

185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153

gh-pages-dns-records

  1. Go to your repo setting.

    1. Rename your repositry name to :example.com
      gh-pages-repo-name

    2. Setting -> Github pages -> Custom domain -> example.com
      gh-pages-custom-domain

  2. Add a CNAME file in your repositry.

examle.com

gh-pages-CNAME

That’s it!

利用Github action (2022.4.16 更新)#

  1. 源代码放main分支

  2. html代码放gh-page分支

FAQ:#

Q: CNAME already taken, what should I do?

A: Ask github for help! They are very nice.Go to see more detail.

参考#

  1. https://docs.github.com/cn/pages/configuring-a-custom-domain-for-your-github-pages-site